{{include_file name='public/header' title='项目主页'}}
{{$user_id = $project.user_id}}

</head>

<body>

<div id="wrapper">

    <!-- Navigation -->
    {{include_file name='public/nav' sidebar='project_sidebar'}}
    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <div class="page-header">
                    <h1>项目主页 </h1>
                    <div class="opt-btn">
                        {{if \app\member::has_rule({{$project.id}}, 'project', 'update')}}
                        <a href="javascript:void(0);" class="btn hidden-xs btn-sm btn-success js_addProjectBtn" data-toggle="tooltip" title="编辑项目" data-placement="bottom" data-id="{{$project.id}}"><i class="fa fa-fw fa-edit"></i>编辑</a>
                        {{/if}}

                        {{if \app\member::has_rule({{$project.id}}, 'project', 'export')}}
                        <a href="{{url("project/export")}}?id={{id_encode($project.id)}}" class="btn hidden-xs btn-sm btn-warning" data-toggle="tooltip" title="导出HTML" data-placement="bottom"><i class="fa fa-fw fa-download"></i>导出</a>
                        {{/if}}
                    </div>
                </div>
            </div>
            <!-- /.col-lg-12 -->
        </div>
        <!-- /.row -->
        <div class="row">

            <div class="col-lg-12">

                <div class="panel panel-default">

                    {{include_file name='project/tab'}}

                    <div class="panel-body">
                        <p class="text-muted"><label>项目名称：</label>{{$project.title}}</p>
                        <p class="text-muted"><label>项目创建人：</label>{{_uri('user', $user_id, 'name')}}({{_uri('user', $user_id, 'email')}}）</p>
                        <p class="text-muted"><label>搜索状态：</label>{{if $project.allow_search}}允许搜索{{else}}禁止搜索{{/if}}</p>
                        <p class="text-muted"><label>创建时间：</label>{{$project.add_time}}</p>
                        <p class="text-muted"><label>更新时间：</label>{{$project.update_time}}</p>

                        <p class="text-muted"><label>项目描述：</label><span style="word-break:break-all">{{$project.intro}}</span></p>
                        <p class="text-muted"><label>环境域名：</label>
                        <div class="table-responsive">
                            <table class="table table-striped table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th>环境标识符</th>
                                    <th>标识符备注</th>
                                    <th>环境域名</th>
                                </tr>
                                </thead>
                                <tbody>
                                {{foreach $envs as $env}}
                                <tr>
                                    <td>{{$env.name}}</td>
                                    <td>{{$env.title}}</td>
                                    <td><code>{{$env.domain}}</code></td>
                                </tr>
                                {{/foreach}}

                                </tbody>
                            </table>

                        </div>
                        </p>
                    </div>
                    <!-- /.panel-body -->
                </div>
                <!-- /.panel -->
            </div>
            <!-- /.col-lg-12 -->
        </div>

        <!-- /.row -->

    </div>
    <!-- /#page-wrapper -->




</div>
<!-- /#wrapper -->
<!-- 编辑项目模态框 -->
<div class="modal fade" id="js_addProjectModal" tabindex="-9" role="dialog">
    <div class="modal-dialog" role="document">

        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">编辑项目</h4>
            </div>
            <div class="modal-body">

                <iframe id="js_addProjectIframe" style="min-height: 375px;" src="{{url('project/add')}}"></iframe>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary js_submit">提交</button>
            </div>

        </div>

    </div>

</div>

<hr>
<p class="text-center">{{get_config('copyright')}}</p>

<script>
    $(function(){

        // 编辑项目
        $(".js_addProjectBtn").iframeModal({
            modalItem: '#js_addProjectModal', //modal元素
            iframeItem: '#js_addProjectIframe', //iframe元素
            submitBtn: '.js_submit',
        });


    });
</script>



{{include_file name='public/footer'}}